# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pydeep
pkgname=('python2-pydeep' 'python-pydeep')
_pkgname=pydeep
pkgver=0.4
pkgrel=8
pkgdesc='This is the Python interface to ssdeep.'
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/pydeep/#files'
license=('custom:PSF')
makedepends=('python2-setuptools' 'python-setuptools' 'ssdeep')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('f924eb61dfba173704b7d8345bf14a8a01a78229b2733309861869f69cd1807325512ada440c7d7ff247fe2ceeca3ac3df2203cb55a5671b658734cb550146f1')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pydeep() {
  depends=('python2' 'ssdeep')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pydeep() {
  depends=('python' 'ssdeep')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

